$(function() {
	$('#vue_vm_list div').hide();
});

var elderOutOrder = {
	elderOutOrderId: '',
	elderId: '',
	orderTime: '',
	status: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
	remark: '',
	subjectRoomId: getLoginedUser().subjectRoomId,
	subjectRoomName: getLoginedUser().subjectRoomName
};

var view = {
	data: elderOutOrder
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view
});

function save() {
	view.data.orderTime = $('#orderYear').val() + '-' + $('#orderMonth').val() + '-' + $('#orderDay').val();
	view.data.status = (view.data.status==''? 0: parseInt(view.data.status));

	save_basic(path+'/elderOutOrder/save', {elderOutOrder:view.data}, function() {
		alert('保存成功');
	});
}

function findAll() {
	if($('#vue_vm_list div').length==0) {return;}
	$('#vue_vm_list div').hide();

	find_basic_by_json(path+'/elderOutOrder/findAll',{status:1}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/elderOutOrder/deleteBatch');
}
